<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/7/13
  Time: 11:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/js/plugins/layui/layui/css/layui.css" media="all">
    <script src="/static/js/plugins/jquery-easyui/jquery.min.js"></script>
    <script src="/static/js/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/js/plugins/layui/layui/lay/modules/form.js"></script>
    <script type="text/javascript" src="/static/js/plugins/layui/layui/lay/modules/element.js"></script>
    <script type="text/javascript" src="/static/js/system/settings.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style>
        .div2 {
            text-align: right;
            padding: 0 20px 0 2px;
        }

        .mylabel {
            width: auto;
            padding: 13px 0 0 25px;
            font-size: 16px;
            color: rgba(0, 0, 0, 0.66);
        }

        .modlebtn {
            padding: 0 0 20px 25px;
        }

        /*body .demo-class .layui-layer-btn{border-top:1px solid #E9E7E7}
        body .demo-class .layui-layer-title{background: #15cc21; color: #3145ff; border: none;}
        body .demo-class .layui-layer-btn a{background:#333;}
        body .demo-class .layui-layer-btn .layui-layer-btn1{background:#999;}*/
        .layui-layer-btn {
            background: #ffffff;
        }

        .layui-layer-content {
            padding: 0 0 20px 15px;
        }

        .myblock {
            width: 500px;
            height: 300px;
            padding: 0 0 20px 15px;
        }

        .messge {
            font-size: 18px;
            padding: 10px 5px 20px 15px;
        }


    </style>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>会员设置</legend>
</fieldset>

<div style="padding: 20px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
        <%--   <div class="layui-col-md6">
               <div class="layui-card">
                   <div class="layui-card-header">会员设置</div>
                   <div class="layui-card-body">
                       卡片式面板面板通常用于非白色背景色的主体内<br>
                       从而映衬出边框投影
                   </div>
               </div>
           </div>
           <div class="layui-col-md6">
               <div class="layui-card">
                   <div class="layui-card-header">会员设置</div>
                   <div class="layui-card-body">
                       结合 layui 的栅格系统<br>
                       轻松实现响应式布局
                   </div>
               </div>
           </div>--%>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">会员级别和折扣设置(会员折扣输入范围：0--10) <font color="#808080"> |
                    以历史积分为标准，设定不同的等级和折扣，刺激消费</font></div>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <form class="layui-form" action="/discountLevel/save" method="post">
                            <div id="mydiv">
                                <div class="layui-form-item " id="myfromdiv">
                                    <div class="layui-form-mid layui-word-aux mytext" align="left">当会员积分在</div>
                                    <input type="hidden" class="myid" id="id" name="entitys[0].id"/>
                                    <div class="layui-input-inline">
                                        <input name="entitys[0].mintotalpoint" placeholder="请输入积分" autocomplete="off"
                                               class="layui-input mymin">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux mytext" align="left">到</div>
                                    <div class="layui-input-inline">
                                        <input name="entitys[0].maxtotalpoint" placeholder="请输入积分" autocomplete="off"
                                               class="layui-input mymax">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux mytext" align="left">之间，可享受</div>
                                    <div class="layui-input-inline">
                                        <input name="entitys[0].discount" placeholder="请输入折扣" autocomplete="off"
                                               class="layui-input mydis">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux mytext" align="left">折，等级名称</div>
                                    <div class="layui-input-inline">
                                        <input name="entitys[0].levelName" placeholder="请输入折扣等级名称" autocomplete="off"
                                               class="layui-input mylevel">
                                    </div>
                                    <button class="layui-btn layui-btn-danger mydelete" name="">删除</button>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button type="button" class="layui-btn layui-btn-normal myadd"><i
                                            class="layui-icon layui-icon-add-1 "></i></button>
                                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">保存
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <%--第二部分div--%>
    <div class="layui-card">
        <div class="layui-form-item layui-form">
            <label class="layui-form-label mylabel">是否开启短信功能</label>
            <div class="layui-input-block div2">
                <input class="cb" value="1" onclick="alert(1)" type="checkbox" name="zzz" lay-skin="switch" lay-filter="ifKeyDemo" lay-text="开启|关闭" checked  >
                <hr>
            </div>
            <div class="modlebtn">
                <button class="layui-btn  layui-btn-radius layui-btn-warm mymodelbtn">选择模版</button>
            </div>
            <hr>
            <label class="layui-form-label messge">编辑短信</label>
            <form class="layui-form" action="/discountLevel/saveMessage" method="post">
                <div class="layui-form-item layui-form-text">
                    <div class="layui-input-block">
                        <textarea name="message" placeholder="请输入内容" class="layui-textarea myblock"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即发送</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<br>
<script src="/static/js/plugins/layui/layui/layui.js" charset="utf-8"></script>
<script>
    $(function () {
        //折扣
        layui.use('form', function () {

            form.on('switch(*)', function(data){
                console.log(data.elem); //得到checkbox原始DOM对象
                console.log(data.elem.checked); //开关是否开启，true或者false
                console.log(data.value); //开关value值，也可以通过data.elem.value得到
                console.log(data.othis); //得到美化后的DOM对象
            });

            var form = layui.form;
            //监听提交
            form.on('submit(form)', function (data) {
                layer.msg(JSON.stringify(data.field));
                return false;
            });
        });

    });
  /*  layui.use(['element', 'layer'], function () {
        var element = layui.element;
        var layer = layui.layer;

        //监听折叠
       /!* element.on('collapse(test)', function (data) {
            layer.msg('展开状态：' + data.show);
        });*!/
    });*/
</script>

</body>
</html>
